import LineEvent, { LineEventModel, LineEventView } from './events/LineEvent'
import StartEvent, { StartEventModel, StartEventView } from './events/StartEvent'
import EndEvent, { EndEventView, EndEventModel } from './events/EndEvent'
import ExclusiveGateway, {
  ExclusiveGatewayView,
  ExclusiveGatewayModel,
} from './gateways/ExclusiveGateway1'
import UserTask, { UserTaskView, UserTaskModel } from './tasks/UserTask'
import TextTask, { TextTaskView, TextTaskModel } from './tasks/TextTask'
import ServiceTask, { ServiceTaskView, ServiceTaskModel } from './tasks/ServiceTask'
import SequenceFlow, { SequenceFlowView, SequenceFlowModel } from './flow/SequenceFlow'
import { theme } from './constant'

// todo: name
class BpmnElement {
  static pluginName = 'bpmnElement'
  constructor({ lf }: { lf: any }) {
    lf.setTheme(theme)
    lf.register(StartEvent)
    lf.register(LineEvent)
    lf.register(EndEvent)
    lf.register(ExclusiveGateway)
    lf.register(UserTask)
    lf.register(TextTask)
    lf.register(ServiceTask)
    // 支持自定义bpmn元素的边
    if (!lf.options.customBpmnEdge) {
      lf.register(SequenceFlow)
      lf.setDefaultEdgeType('bpmn2:sequenceFlow')
    }
  }
}

export {
  BpmnElement,
  LineEventModel,
  LineEventView,
  StartEventModel,
  StartEventView,
  EndEventView,
  EndEventModel,
  ExclusiveGatewayView,
  ExclusiveGatewayModel,
  UserTaskView,
  UserTaskModel,
  TextTaskView,
  TextTaskModel,
  ServiceTaskView,
  ServiceTaskModel,
  SequenceFlowView,
  SequenceFlowModel,
}
